# coding:utf-8

with open("keyevent.txt") as f:
    w = open("w.txt", 'w')
    for l in f.readlines():
        ll = l.split(' ')
        print str(ll), int(ll[2], 16), int(ll[3], 16), int(ll[-1].strip('\n'), 16)
        ll[2], ll[3], ll[4] = str(int(ll[2], 16)), str(int(ll[3], 16)), str(int(ll[-1].strip('\n'), 16))
        print str(ll)
        w.write(' '.join(ll) + '\n')
        # break
    w.close()
